import 'package:flutter/material.dart';

class DnpTopTitleWidget extends StatelessWidget {

  final String? titleName;

  final Function()? onTap;

  DnpTopTitleWidget({
    super.key,
    this.titleName,
    this.onTap
  });

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 44,
      child: Stack(
        children: [
          Positioned(
            top: 5,
            left: 14,
            child: GestureDetector(
              onTap: (){
                Navigator.pop(context);
                if (onTap != null) {
                  onTap!();
                }
              },
              child: Image.asset(
                'assets/images/ic_certification_back.png',
                width: 34,
                height: 34,
              ),
            ),
          ),
          Center(
            child: Text(
              titleName ?? "",
              style: TextStyle(
                fontSize: 16,
                fontWeight: FontWeight.w600,
                color: Colors.white
              ),
            ),
          )
        ],
      ),
    );
  }
}
